mem_access: sanitize code around sending vm_event request
authorTamas K Lengyel <tamas.lengyel@zentific.com>
Tue, 6 Sep 2016 08:17:46 +0000 (10:17 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 Sep 2016 08:17:46 +0000 (10:17 +0200)
commit3adef8e3270f5a524dc31c90db6ca389df61e1f0
tree70b16699aee468357032f742a606f20b9128ef15
parent343f84be135e6f9e681960a9e235296eae159fc8
mem_access: sanitize code around sending vm_event request

The two functions monitor_traps and mem_access_send_req duplicate some of the
same functionality. The mem_access_send_req however leaves a lot of the
standard vm_event fields to be filled by other functions.

Remove mem_access_send_req() completely, making use of monitor_traps() to put
requests into the monitor ring.  This in turn causes some cleanup around the
old callsites of mem_access_send_req(). We also update monitor_traps to now
include setting the common vcpu_id field so that all other call-sites can ommit
this step.

Finally, this change identifies that errors from mem_access_send_req() were
never checked.  As errors constitute a problem with the monitor ring,
crashing the domain is the most appropriate action to take.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/monitor.c
xen/arch/x86/mm/p2m.c
xen/common/mem_access.c
xen/common/monitor.c
xen/include/asm-x86/p2m.h
xen/include/xen/mem_access.h